# -*- coding: utf-8 -*-
# @Time : 2021/3/4 下午 3:20
# @Author : lijunlong
# @Email : 729619494@qq.com
# @File : create_datas.py
# @Project : xiaobai

import requests

class Datas():

    def register_respon(self):
        url = "http://hn216.api.yesapi.cn/?s=App.User.Register"
        payload = {
            "app_key":"1D8CE9A70332B3D629020062120136D5",
            "username":"user1",
            "password":"e10adc3949ba59abbe56e057f20f883e"
        }
        r = requests.post(url,json=payload)
        respon = r.json()
        return respon.get("data")

    def login_respon(self):
        url = "http://hn216.api.yesapi.cn/?s=App.User.Login"
        payload = {
            "app_key":"1D8CE9A70332B3D629020062120136D5",
            "username":"user1",
            "password":"e10adc3949ba59abbe56e057f20f883e"
        }
        r = requests.post(url,json=payload)
        respon = r.json()
        return respon.get("data")

    def loginout(self,uuid,token):
        url = "http://hn216.api.yesapi.cn/?s=App.User.Logout"
        payload = {
            "app_key": "1D8CE9A70332B3D629020062120136D5",
            "uuid": uuid,
            "token": token
        }
        requests.post(url,json=payload)


